<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
	<CodeSnippet Format="1.0.0">
		<Header>
			<Title>entity</Title>
			<Shortcut>gentity</Shortcut>
			<Description>ZEQP Entity自动生成</Description>
			<Author>ZEQP</Author>
			<SnippetTypes>
				<SnippetType>Expansion</SnippetType>
				<SnippetType>SurroundsWith</SnippetType>
			</SnippetTypes>
		</Header>
		<Snippet>
			<Declarations>
        <Literal>
          <ID>name</ID>
          <ToolTip>实体名称</ToolTip>
          <Default>CF_Entity</Default>
        </Literal>
			</Declarations>
			<Code Language="csharp">
      <![CDATA[using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using PMS.XCMG.Util;

namespace PMS.XCMG.Entity
{
    /// <summary>
    /// $name$
    /// </summary>
    public partial class $name$ : BusEntity
    {
        /// <summary>
        /// 编码
        /// </summary>
        public string Code { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }$end$
    }

    public partial class $name$ : BusEntity
    {
    }

    /// <summary>
    /// 实体配置
    /// OnModelCreating
    /// </summary>
    public class $name$TypeConfig : BusEntityTypeConfig<$name$>, IEntityTypeConfiguration<$name$>
    {
        public override void Configure(EntityTypeBuilder<$name$> builder)
        {
            base.Configure(builder);

            #region 主外键关系
            #endregion

            #region 字段属性:最大长度,是否必需,默认值
            builder.Property(p => p.Code).HasMaxLength(EntityDefinition.DefSmallColLen).IsRequired();
            builder.Property(p => p.Name).HasMaxLength(EntityDefinition.DefSmallColLen).IsRequired();
            #endregion

            #region 备注
            builder.HasComment("$name$");
            builder.Property(p => p.Code).HasComment("编码");
            builder.Property(p => p.Name).HasComment("名称");
            #endregion

            #region 种子数据
            #endregion
        }
    }
}
]]>
			</Code>
		</Snippet>
	</CodeSnippet>
</CodeSnippets>
